<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon32.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon16.ico?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="CG,">










<meta name="description" content="Importance Sampling作为渲染的核心技术，无论是离线还是实时中都有大量应用，是所有光照学习的基础。">
<meta name="keywords" content="CG">
<meta property="og:type" content="article">
<meta property="og:title" content="Multiple Importance Sampling">
<meta property="og:url" content="http://htelepathh.gitee.io/2022/04/21/Multiple-Importance-Sampling/index.html">
<meta property="og:site_name" content="OUTPUT">
<meta property="og:description" content="Importance Sampling作为渲染的核心技术，无论是离线还是实时中都有大量应用，是所有光照学习的基础。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://htelepathh.gitee.io/2022/04/21/Multiple-Importance-Sampling/solid_angle.jpg">
<meta property="og:image" content="http://htelepathh.gitee.io/2022/04/21/Multiple-Importance-Sampling/solid_angle_area_light.png">
<meta property="og:updated_time" content="2022-12-06T18:55:26.172Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Multiple Importance Sampling">
<meta name="twitter:description" content="Importance Sampling作为渲染的核心技术，无论是离线还是实时中都有大量应用，是所有光照学习的基础。">
<meta name="twitter:image" content="http://htelepathh.gitee.io/2022/04/21/Multiple-Importance-Sampling/solid_angle.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":true},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://htelepathh.gitee.io/2022/04/21/Multiple-Importance-Sampling/">





  <title>Multiple Importance Sampling | OUTPUT</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">OUTPUT</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">HTelepathH's blog</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://htelepathh.gitee.io/2022/04/21/Multiple-Importance-Sampling/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="HTelepathH">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/MOB.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="OUTPUT">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Multiple Importance Sampling</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2022-04-21T20:16:17+08:00">
                2022-04-21
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/math/" itemprop="url" rel="index">
                    <span itemprop="name">math</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>Importance Sampling作为渲染的核心技术，无论是离线还是实时中都有大量应用，是所有光照学习的基础。<br><a id="more"></a></p>
<h2 id="Mote-Carlo-integration"><a href="#Mote-Carlo-integration" class="headerlink" title="Mote Carlo integration"></a>Mote Carlo integration</h2><p>使用随机采样概率模型$P$计算积分，并用采样分布$P$的pdf(<strong>probability density function</strong> $p(x)$)进行归一化，设$N$个采样点$X_1,…X_N$</p>
<script type="math/tex; mode=display">I=\int_\Omega f(x)d\mu(x)\approx F_N=\frac{1}{N}\sum_{i=1}^N\frac{f(X_i)}{p(X_i)}</script><p>当采样分布$P$的CDF与目标被积函数$f(x)$成比例关系时，$p(x)=kf(x)$，积分方差为0，只需1 sample即收敛</p>
<script type="math/tex; mode=display">D[F_N]=D[\frac{1}{N}\sum_{i=1}^N\frac{f(X_i)}{p(X_i)}]=\frac{1}{N}D[\frac{f(x)}{p(x)}]=\frac{1}{N}D[\frac{f(x)}{cf(x)}]=0</script><h2 id="The-Inversion-Method"><a href="#The-Inversion-Method" class="headerlink" title="The Inversion Method"></a>The Inversion Method</h2><p>输入一个均匀分布$U(0,1)$的随机变量$X$，如何将这个随机变量通过$Y=f(X)$映射到其他的采样分布$Q$。<br>即</p>
<script type="math/tex; mode=display">X\sim U(0,1)\rightarrow f(X)\sim Q =Y\sim Q</script><p>设$Q_Y(\cdot)$为$Q$的CDF，$U_X(\cdot)$为均匀分布$U(0,1)$的CDF，则有</p>
<script type="math/tex; mode=display">Q_Y(x) = P(Y\leq x)=P(f(X)\leq x)=P(X\leq f^{-1}(x)) = U_X(f^{-1}(x))</script><p>对于均匀分布$U(0,1)$的CDF，$U_X(x)=P(X\leq x)=x$，有$Q_Y(x) = f^{-1}(x)$</p>
<script type="math/tex; mode=display">f(x)=Q_Y^{-1}(x)</script><p>在使用均匀分布的随机变量$X$时，带入目标分布$Q$的CDF的逆函数$Q^{-1}(x)$即可得到目标分布。</p>
<h3 id="More-General-Case"><a href="#More-General-Case" class="headerlink" title="More General Case"></a>More General Case</h3><p>显然$P(f(X)\leq x)=P(X\leq f^{-1}(x))$成立的前提，是反函数存在，也就是$f:X\rightarrow Y$是严格单调的（一一对应）。这一点其实由概率分布的特点保证，如果$X$多个值映射到一个$y$，那么就不能明确描述特定$y$的pdf。且CDF有</p>
<script type="math/tex; mode=display">P(Y\leq f(x))=P(X\leq x) \\
P_y(y)=P_y(f(x))=P_x(x)</script><p>对CDF作微分</p>
<script type="math/tex; mode=display">p_y(y)=(\frac{\text{d}y}{\text{d}x})^{-1}p_x(x)</script><h4 id="Multiple-Dimensions"><a href="#Multiple-Dimensions" class="headerlink" title="Multiple Dimensions"></a>Multiple Dimensions</h4><p>假设$X$为$n$维随机变量，$Y=T(X)$，$T$为双射，变换后的cdf为</p>
<script type="math/tex; mode=display">p_y(y)=p_y(f(x))=\frac{p_x(x)}{|J_T(x)|}</script><script type="math/tex; mode=display">J_T(x)=\begin{bmatrix}
\partial T_1/\partial x_1  & \cdots\ & \partial T_1/\partial x_n \\
\vdots & \ddots  & \vdots  \\
\partial T_n/\partial x_1  & \cdots\ & \partial T_n/\partial x_n\\
\end{bmatrix}</script><p>$J_T(x)$为Jacobian矩阵</p>
<p>多维的转换公式可以让我们获得各个坐标系之间的关系</p>
<h5 id="Polar-Coordinates"><a href="#Polar-Coordinates" class="headerlink" title="Polar Coordinates"></a>Polar Coordinates</h5><script type="math/tex; mode=display">
x=r\cos\theta \\
y=r\sin\theta</script><script type="math/tex; mode=display">
|J_T(x)|=
\left |\begin{matrix}
\partial x/\partial r  & \partial x/\partial \theta \\
\partial y/\partial r  & \partial y/\partial \theta 
\end{matrix}\right |
=
\left |\begin{matrix}
\cos\theta  & -r\sin\theta \\
\sin\theta & r\cos\theta
\end{matrix}\right |
=r</script><script type="math/tex; mode=display">p(r,\theta)=rp(x,y)</script><h5 id="Spherical-Coordinates"><a href="#Spherical-Coordinates" class="headerlink" title="Spherical Coordinates"></a>Spherical Coordinates</h5><script type="math/tex; mode=display">
x=r\sin\theta\cos\phi\\
y=r\sin\theta\sin\phi\\
z=r\cos\theta</script><script type="math/tex; mode=display">
|J_T(x)|=
\left |\begin{matrix}
\partial x/\partial r  & \partial x/\partial \theta & \partial x/\partial \phi \\
\partial y/\partial r  & \partial y/\partial \theta & \partial y/\partial \phi \\
\partial z/\partial r  & \partial z/\partial \theta & \partial z/\partial \phi \\
\end{matrix}\right |
=
\left |\begin{matrix}
\sin\theta\cos\phi  & r\cos\theta\cos\phi & -r\sin\theta\sin\phi \\
\sin\theta\sin\phi   & r\cos\theta\sin\phi & r\sin\theta\cos\phi \\
\cos\theta  & -r\sin\theta & 0 \\
\end{matrix}\right |
=r^2\sin\theta</script><script type="math/tex; mode=display">
p(r,\theta,\phi)=r^2\sin\theta p(x,y,z)</script><h5 id="Solid-Angle"><a href="#Solid-Angle" class="headerlink" title="Solid Angle"></a>Solid Angle</h5><img src="/2022/04/21/Multiple-Importance-Sampling/solid_angle.jpg" title="$\text{d}\omega=\sin\theta\text{d}\theta\text{d}\phi$">
<p>那么就有</p>
<script type="math/tex; mode=display">\int_{\Omega^+}p(\omega)d\omega=\int_{\Omega^+}p(\omega)\sin\theta d\theta d\phi=1 \\
p(\theta,\phi)=\sin\theta p(\omega)</script><h3 id="Hemisphere-Distribution"><a href="#Hemisphere-Distribution" class="headerlink" title="Hemisphere Distribution"></a>Hemisphere Distribution</h3><p>立体角pdf为$p(\omega)=\frac{1}{2\pi}$，由$p(\theta,\phi)=sin\theta p(\omega)$，极坐标下</p>
<script type="math/tex; mode=display">p(\theta,\phi)=\frac{\sin\theta}{2\pi}</script><p>边缘积分得到$\theta$的pdf。</p>
<script type="math/tex; mode=display">pdf(\theta)=\int_0^{2\pi}p(\theta,\phi)d\phi=\sin\theta \\
pdf(\phi|\theta)=\frac{p(\theta,\phi)}{p(\theta)}=\frac{1}{2\pi}</script><p>积分得到CDF和逆函数</p>
<script type="math/tex; mode=display">P(\theta)=\int_0^\theta\sin x dx=1-\cos\theta \\
P(\phi|\theta)=\int_0^\phi\frac{1}{2\pi}dx=\frac{\phi}{2\pi}</script><p>$\xi_1,\xi_2$为$U(0,1)$的独立随机变量，$1-\xi_1$可替换为$\xi_1$</p>
<script type="math/tex; mode=display">\theta = \cos^{-1}\xi_1 \\
\phi = 2\pi\xi_2</script><script type="math/tex; mode=display">
\begin{cases}
x=\sin\theta\cos\phi=\cos(2\pi\xi_2)\sqrt{1-\xi_1^2}\\
y=\sin\theta\sin\phi=\sin(2\pi\xi_2)\sqrt{1-\xi_1^2}\\
z=\cos\theta=\xi_1
\end{cases}</script><h3 id="Cosine-weighted-Hemisphere-Distribution"><a href="#Cosine-weighted-Hemisphere-Distribution" class="headerlink" title="Cosine-weighted Hemisphere Distribution"></a>Cosine-weighted Hemisphere Distribution</h3><p>立体角pdf为$p(\omega)\propto\cos\theta$，$\int_{\Omega^+}p(\omega)d\omega=\int_{\Omega^+}k\cos\theta\sin\theta d\theta d\phi=1$<br>得到</p>
<script type="math/tex; mode=display">p(\theta,\phi)=\frac{1}{\pi}\cos\theta\sin\theta</script><p>边缘积分得到pdf，再积分得到CDF</p>
<script type="math/tex; mode=display">pdf(\theta)=\int_0^{2\pi}p(\theta,\phi)d\phi=\sin2\theta \\
pdf(\phi|\theta)=\frac{p(\theta,\phi)}{p(\theta)}=\frac{1}{2\pi}</script><script type="math/tex; mode=display">P(\theta)=\int_0^\theta\sin 2x dx=1-\cos^2\theta \\
P(\phi|\theta)=\int_0^\phi\frac{1}{2\pi}dx=\frac{\phi}{2\pi}</script><p>$\xi_1,\xi_2$为$U(0,1)$的独立随机变量</p>
<script type="math/tex; mode=display">
\theta = \cos^{-1}\sqrt{1-\xi_1}\\
\phi = 2\pi\xi_2</script><script type="math/tex; mode=display">
\begin{cases}
x=\sin\theta\cos\phi=\cos(2\pi\xi_2)\sqrt{\xi_1}\\
y=\sin\theta\sin\phi=\sin(2\pi\xi_2)\sqrt{\xi_1}\\
z=\cos\theta=\sqrt{1-\xi_1}
\end{cases}</script><h2 id="Importance-Sampling"><a href="#Importance-Sampling" class="headerlink" title="Importance Sampling"></a>Importance Sampling</h2><h3 id="Rendering-Equation"><a href="#Rendering-Equation" class="headerlink" title="Rendering Equation"></a>Rendering Equation</h3><script type="math/tex; mode=display">L(p,\omega_o)=L_e(p,\omega_o)+
\int_\Omega L_i(p,\omega_i)f(\omega_i,\omega_o)|\omega_i\cdot\omega_g|d\omega_i</script><h3 id="Sampling-the-BSDF"><a href="#Sampling-the-BSDF" class="headerlink" title="Sampling the BSDF"></a>Sampling the BSDF</h3><p>BSDF中的仅讨论BRDF，$f(\omega_i,\omega_o)$为BRDF，为了解渲染方程我们需要采样$\omega_i$计算$f(\omega_i,\omega_o)|\omega_i\cdot\omega_g|$</p>
<h4 id="Sampling-D-NDF"><a href="#Sampling-D-NDF" class="headerlink" title="Sampling $D$ (NDF)"></a>Sampling $D$ (NDF)</h4><p><a href="https://pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Sampling_Reflection_Functions" target="_blank" rel="noopener">PBRT</a>中有对Beckmann的采样。对于GGX和Blinn的采样可见<a href="https://agraphicsguynotes.com/posts/sample_microfacet_brdf/" target="_blank" rel="noopener">Cao’s Blog</a>，这里写一下GGX的采样方法。</p>
<script type="math/tex; mode=display">D_{GGX}(h)=\frac{\alpha^2}{\pi(\cos^2\theta_h(\alpha^2-1)+1)^2}</script><p>根据立体角的定义</p>
<script type="math/tex; mode=display">\int_{\Omega^+} D(\omega)(\omega\cdot n)dw=1 \\
\int_{\Omega^+}D(\omega)\cos\theta d\omega
=\int_{\Omega^+}p(\omega)d\omega \\
=\int_{\Omega^+}p(\omega)\sin\theta d\theta d\phi
=\int_{\Omega^+}p(\theta,\phi)d\theta d\phi
=1</script><p>则有$p(\omega)=D(\omega)\cos\theta$，$p(\theta,\phi)=p(\omega)\sin\theta$</p>
<script type="math/tex; mode=display">
p(h)=\frac{\alpha^2\cos\theta}{\pi(\cos^2\theta(\alpha^2-1)+1)^2}\\
p(\theta,\phi)=\frac{\alpha^2\cos\theta\sin\theta}{\pi(\cos^2\theta(\alpha^2-1)+1)^2}</script><p>对pdf积分</p>
<script type="math/tex; mode=display">p_h(\theta)=\int_0^{2\pi}p_h(\theta,\phi)=\frac{2\alpha^2\cos\theta\sin\theta}{(\cos^2\theta(\alpha^2-1)+1)^2} \\
P_h(\theta)=\int_0^\theta\frac{2\alpha^2\cos t\sin t}{(\cos^2 t(\alpha^2-1)+1)^2}dt\\
=\frac{\alpha^2}{\cos^2(\alpha^2-1)^2+(\alpha^2-1)}-\frac{1}{\alpha^2-1}</script><p>$\xi_1,\xi_2$为$U(0,1)$的独立随机变量</p>
<script type="math/tex; mode=display">
\theta=\arccos\sqrt{\frac{1-\xi_1}{\xi_1(\alpha^2-1)+1}}\\
\phi=2\pi\xi_2</script><p>现在我们可以随机采样$\omega_h$，但我们需要采样光线$\omega_i$，有如下反射关系</p>
<script type="math/tex; mode=display">\omega_i=2|\omega_o\cdot\omega_m|\omega_m-\omega_o</script><p>则反射变换的Jacobian行列式(证明见<a href="https://www.graphics.cornell.edu/~bjw/wardnotes.pdf" target="_blank" rel="noopener">Notes on the Ward BRDF</a>,<a href="https://schuttejoe.github.io/post/ggximportancesamplingpart1/" target="_blank" rel="noopener">explanation</a>)为</p>
<script type="math/tex; mode=display">|J_R|=4|\omega_o\cdot\omega_m|</script><p>那么$\omega_i$的pdf为</p>
<script type="math/tex; mode=display">p_i(\omega_m,\omega_o)=\frac{D(\omega_m)\omega_g\cdot\omega_m}{4|\omega_o\cdot\omega_m|}</script><p>需要计算的采样值为（使用pdf归一化）</p>
<script type="math/tex; mode=display">\frac{f(\omega_i,\omega_o)|\omega_i\cdot\omega_g|}{p_i(\omega_m,\omega_o)}=\frac{F(\omega_i,\omega_h)G(\omega_i,\omega_o,\omega_h)|\omega_o\cdot\omega_h|}{|\omega_o\cdot\omega_g||\omega_h\cdot\omega_g|}</script><p><a href="https://schuttejoe.github.io/post/ggximportancesamplingpart2/" target="_blank" rel="noopener">A Simpler and Exact Sampling Routine for the GGX Distribution of Visible Normals</a></p>
<h3 id="Sampling-the-light-source"><a href="#Sampling-the-light-source" class="headerlink" title="Sampling the light source"></a>Sampling the light source</h3><img src="/2022/04/21/Multiple-Importance-Sampling/solid_angle_area_light.png" title="$d\omega$与$dA$的关系">
<script type="math/tex; mode=display">d\omega_i=\frac{dA\cos\theta_o}{r^2}</script><p>对于图中的矩形光源，可以直接在光源上采样并积分，pdf为$\frac{1}{A}$</p>
<p>对于更多的光源，如球形，三角形等，见<a href="https://pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Sampling_Light_Sources" target="_blank" rel="noopener">PBRT</a></p>
<h2 id="Multiple-Importance-Sampling"><a href="#Multiple-Importance-Sampling" class="headerlink" title="Multiple Importance Sampling"></a>Multiple Importance Sampling</h2><p>MIS使用多种pdf进行采样，并在每种pdf内用weight $w_i(\cdot)$做归一化。$Y_{i,j}$表示第i种pdf中的第j个样本。而每种pdf可以与乘积形式的被积函数中的某些部分成正比来加速收敛。</p>
<script type="math/tex; mode=display">F=\sum_{i=1}^n\frac{1}{n_i}\sum_{i=1}^{n_i}w_i(Y_{i,j})\frac{f(Y_{i,j}) } {p_i(Y_ {i,j})}</script><p>要保证多种pdf的采样结果是无偏的，需要满足</p>
<ul>
<li>$\sum_{i=1}^nw_i(x)=1,\forall f(x)\neq 0$</li>
<li>$w_i(x)=0,\forall p_i(x)=0$</li>
</ul>
<p>weight有两种计算方式</p>
<h3 id="Balance-heuristic"><a href="#Balance-heuristic" class="headerlink" title="Balance heuristic"></a>Balance heuristic</h3><script type="math/tex; mode=display">w_s(x)=\frac{n_sp_s(x)}{\sum_i n_ip_i(x)}</script><p>最直觉的归一化，在哪个分布里pdf大，weight就高</p>
<h3 id="Power-heuristic"><a href="#Power-heuristic" class="headerlink" title="Power heuristic"></a>Power heuristic</h3><script type="math/tex; mode=display">w_s(x)=\frac{(n_sp_s(x))^\beta}{\sum_i (n_ip_i(x))^\beta}</script><p>扩展了Balance的方法，继续扩大pdf之间的差距，类似softmax。Veach的<a href="https://cseweb.ucsd.edu/~viscomp/classes/cse168/sp21/readings/veach.pdf" target="_blank" rel="noopener">原文</a>中建议$\beta=2$效果较好</p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/CG/" rel="tag"># CG</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2021/10/27/What-is-an-RKHS-2/" rel="next" title="What is an RKHS [2]">
                <i class="fa fa-chevron-left"></i> What is an RKHS [2]
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2022/04/23/Material-System-in-Filament-材质模型/" rel="prev" title="Material System in Filament : 材质模型">
                Material System in Filament : 材质模型 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
      <div id="sidebar-dimmer"></div>
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/MOB.jpg" alt="HTelepathH">
            
              <p class="site-author-name" itemprop="name">HTelepathH</p>
              <p class="site-description motion-element" itemprop="description">Learning by doing.</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives">
              
                  <span class="site-state-item-count">25</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">12</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">15</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="99088577@qq.com" target="_blank" title="Mail">
                      Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://gitee.com/htelepathh" target="_blank" title="Gitee">
                      Gitee</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/htlpt" target="_blank" title="GitHub">
                      GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/u/6207125886" target="_blank" title="微博">
                      微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/huang-he-tu" target="_blank" title="知乎">
                      知乎</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Mote-Carlo-integration"><span class="nav-number">1.</span> <span class="nav-text">Mote Carlo integration</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#The-Inversion-Method"><span class="nav-number">2.</span> <span class="nav-text">The Inversion Method</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#More-General-Case"><span class="nav-number">2.1.</span> <span class="nav-text">More General Case</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Multiple-Dimensions"><span class="nav-number">2.1.1.</span> <span class="nav-text">Multiple Dimensions</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#Polar-Coordinates"><span class="nav-number">2.1.1.1.</span> <span class="nav-text">Polar Coordinates</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Spherical-Coordinates"><span class="nav-number">2.1.1.2.</span> <span class="nav-text">Spherical Coordinates</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Solid-Angle"><span class="nav-number">2.1.1.3.</span> <span class="nav-text">Solid Angle</span></a></li></ol></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Hemisphere-Distribution"><span class="nav-number">2.2.</span> <span class="nav-text">Hemisphere Distribution</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Cosine-weighted-Hemisphere-Distribution"><span class="nav-number">2.3.</span> <span class="nav-text">Cosine-weighted Hemisphere Distribution</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Importance-Sampling"><span class="nav-number">3.</span> <span class="nav-text">Importance Sampling</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Rendering-Equation"><span class="nav-number">3.1.</span> <span class="nav-text">Rendering Equation</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Sampling-the-BSDF"><span class="nav-number">3.2.</span> <span class="nav-text">Sampling the BSDF</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Sampling-D-NDF"><span class="nav-number">3.2.1.</span> <span class="nav-text">Sampling $D$ (NDF)</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Sampling-the-light-source"><span class="nav-number">3.3.</span> <span class="nav-text">Sampling the light source</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Multiple-Importance-Sampling"><span class="nav-number">4.</span> <span class="nav-text">Multiple Importance Sampling</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Balance-heuristic"><span class="nav-number">4.1.</span> <span class="nav-text">Balance heuristic</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Power-heuristic"><span class="nav-number">4.2.</span> <span class="nav-text">Power heuristic</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-angle-double-left"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">HTelepathH</span>

  
</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          displayMath: [ ['$$', '$$']],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  

</body>
</html>
